home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat3 / Tk / canvtkwin.z / canvtkwin
Text File  |  1998-10-30  |  12KB  |  199 lines

  1.  
  2.  
  3.  
  4. TTTTkkkk____CCCCaaaannnnvvvvaaaassssTTTTkkkkwwwwiiiinnnn((((3333TTTTkkkk))))                                        TTTTkkkk____CCCCaaaannnnvvvvaaaassssTTTTkkkkwwwwiiiinnnn((((3333TTTTkkkk))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      Tk_CanvasTkwin, Tk_CanvasGetCoord, Tk_CanvasDrawableCoords,
  10.      Tk_CanvasSetStippleOrigin, Tk_CanvasWindowCoords,
  11.      Tk_CanvasEventuallyRedraw - utility procedures for canvas type managers
  12.  
  13. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.      ####iiiinnnncccclllluuuuddddeeee <<<<ttttkkkk....hhhh>>>>
  15.  
  16.      Tk_Window
  17.      TTTTkkkk____CCCCaaaannnnvvvvaaaassssTTTTkkkkwwwwiiiinnnn(_c_a_n_v_a_s)
  18.  
  19.      int
  20.      TTTTkkkk____CCCCaaaannnnvvvvaaaassssGGGGeeeettttCCCCoooooooorrrrdddd(_i_n_t_e_r_p, _c_a_n_v_a_s, _s_t_r_i_n_g, _d_o_u_b_l_e_P_t_r)
  21.  
  22.      TTTTkkkk____CCCCaaaannnnvvvvaaaassssDDDDrrrraaaawwwwaaaabbbblllleeeeCCCCoooooooorrrrddddssss(_c_a_n_v_a_s, _x, _y, _d_r_a_w_a_b_l_e_X_P_t_r, _d_r_a_w_a_b_l_e_Y_P_t_r)
  23.  
  24.      TTTTkkkk____CCCCaaaannnnvvvvaaaassssSSSSeeeettttSSSSttttiiiipppppppplllleeeeOOOOrrrriiiiggggiiiinnnn(_c_a_n_v_a_s, _g_c)
  25.  
  26.      TTTTkkkk____CCCCaaaannnnvvvvaaaassssWWWWiiiinnnnddddoooowwwwCCCCoooooooorrrrddddssss(_c_a_n_v_a_s, _x, _y, _s_c_r_e_e_n_X_P_t_r, _s_c_r_e_e_n_Y_P_t_r)
  27.  
  28.      TTTTkkkk____CCCCaaaannnnvvvvaaaassssEEEEvvvveeeennnnttttuuuuaaaallllllllyyyyRRRReeeeddddrrrraaaawwww(_c_a_n_v_a_s, _x_1, _y_1, _x_2, _y_2)
  29.  
  30. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  31.      Tk_Canvas     _c_a_n_v_a_s          (in)      A token that identifies a canvas
  32.                                              widget.
  33.  
  34.      Tcl_Interp    *_i_n_t_e_r_p         (in/out)  Interpreter to use for error
  35.                                              reporting.
  36.  
  37.      char          *_s_t_r_i_n_g         (in)      Textual description of a canvas
  38.                                              coordinate.
  39.  
  40.      double        *_d_o_u_b_l_e_P_t_r      (out)     Points to place to store a
  41.                                              converted coordinate.
  42.  
  43.      double        _x               (in)      An x coordinate in the space of
  44.                                              the canvas.
  45.  
  46.      double        _y               (in)      A y coordinate in the space of
  47.                                              the canvas.
  48.  
  49.      short         *_d_r_a_w_a_b_l_e_X_P_t_r   (out)     Pointer to a location in which to
  50.                                              store an x coordinate in the
  51.                                              space of the drawable currently
  52.                                              being used to redisplay the
  53.                                              canvas.
  54.  
  55.      short         *_d_r_a_w_a_b_l_e_Y_P_t_r   (out)     Pointer to a location in which to
  56.                                              store a y coordinate in the space
  57.                                              of the drawable currently being
  58.                                              used to redisplay the canvas.
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TTTTkkkk____CCCCaaaannnnvvvvaaaassssTTTTkkkkwwwwiiiinnnn((((3333TTTTkkkk))))                                        TTTTkkkk____CCCCaaaannnnvvvvaaaassssTTTTkkkkwwwwiiiinnnn((((3333TTTTkkkk))))
  71.  
  72.  
  73.  
  74.      GC            _g_c              (out)     Graphics context to modify.
  75.  
  76.      short         *_s_c_r_e_e_n_X_P_t_r     (out)     Points to a location in which to
  77.                                              store the screen coordinate in
  78.                                              the canvas window that
  79.                                              corresponds to _x.
  80.  
  81.      short         *_s_c_r_e_e_n_Y_P_t_r     (out)     Points to a location in which to
  82.                                              store the screen coordinate in
  83.                                              the canvas window that
  84.                                              corresponds to _y.
  85.  
  86.      int           _x_1              (in)      Left edge of the region that
  87.                                              needs redisplay.  Only pixels at
  88.                                              or to the right of this
  89.                                              coordinate need to be
  90.                                              redisplayed.
  91.  
  92.      int           _y_1              (in)      Top edge of the region that needs
  93.                                              redisplay.  Only pixels at or
  94.                                              below this coordinate need to be
  95.                                              redisplayed.
  96.  
  97.      int           _x_2              (in)      Right edge of the region that
  98.                                              needs redisplay.  Only pixels to
  99.                                              the left of this coordinate need
  100.                                              to be redisplayed.
  101.  
  102.      int           _y_2              (in)      Bottom edge of the region that
  103.                                              needs redisplay.  Only pixels
  104.                                              above this coordinate need to be
  105.                                              redisplayed.
  106.  
  107.  
  108.  
  109. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  110.      These procedures are called by canvas type managers to perform various
  111.      utility functions.
  112.  
  113.      TTTTkkkk____CCCCaaaannnnvvvvaaaassssTTTTkkkkwwwwiiiinnnn returns the Tk_Window associated with a particular canvas.
  114.  
  115.      TTTTkkkk____CCCCaaaannnnvvvvaaaassssGGGGeeeettttCCCCoooooooorrrrdddd translates a string specification of a coordinate (such
  116.      as 2222pppp or 1111....6666cccc) into a double-precision canvas coordinate.  If _s_t_r_i_n_g is a
  117.      valid coordinate description then TTTTkkkk____CCCCaaaannnnvvvvaaaassssGGGGeeeettttCCCCoooooooorrrrdddd stores the
  118.      corresponding canvas coordinate at *_d_o_u_b_l_e_P_t_r and returns TCL_OK.
  119.      Otherwise it stores an error message in _i_n_t_e_r_p->_r_e_s_u_l_t and returns
  120.      TCL_ERROR.
  121.  
  122.      TTTTkkkk____CCCCaaaannnnvvvvaaaassssDDDDrrrraaaawwwwaaaabbbblllleeeeCCCCoooooooorrrrddddssss is called by type managers during redisplay to
  123.      compute where to draw things.  Given _x and _y coordinates in the space of
  124.      the canvas, TTTTkkkk____CCCCaaaannnnvvvvaaaassssDDDDrrrraaaawwwwaaaabbbblllleeeeCCCCoooooooorrrrddddssss computes the corresponding pixel in
  125.      the drawable that is currently being used for redisplay; it returns those
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. TTTTkkkk____CCCCaaaannnnvvvvaaaassssTTTTkkkkwwwwiiiinnnn((((3333TTTTkkkk))))                                        TTTTkkkk____CCCCaaaannnnvvvvaaaassssTTTTkkkkwwwwiiiinnnn((((3333TTTTkkkk))))
  137.  
  138.  
  139.  
  140.      coordinates in *_d_r_a_w_a_b_l_e_X_P_t_r and *_d_r_a_w_a_b_l_e_Y_P_t_r.  This procedure should
  141.      not be invoked except during redisplay.
  142.  
  143.      TTTTkkkk____CCCCaaaannnnvvvvaaaassssSSSSeeeettttSSSSttttiiiipppppppplllleeeeOOOOrrrriiiiggggiiiinnnn is also used during redisplay.  It sets the
  144.      stipple origin in _g_c so that stipples drawn with _g_c in the current
  145.      offscreen pixmap will line up with stipples drawn with origin (0,0) in
  146.      the canvas's actual window.  TTTTkkkk____CCCCaaaannnnvvvvaaaassssSSSSeeeettttSSSSttttiiiipppppppplllleeeeOOOOrrrriiiiggggiiiinnnn is needed in order
  147.      to guarantee that stipple patterns line up properly when the canvas is
  148.      redisplayed in small pieces.  Redisplays are carried out in double-
  149.      buffered fashion where a piece of the canvas is redrawn in an offscreen
  150.      pixmap and then copied back onto the screen.  In this approach the
  151.      stipple origins in graphics contexts need to be adjusted during each
  152.      redisplay to compensate for the position of the off-screen pixmap
  153.      relative to the window.  If an item is being drawn with stipples, its
  154.      type manager typically calls TTTTkkkk____CCCCaaaannnnvvvvaaaassssSSSSeeeettttSSSSttttiiiipppppppplllleeeeOOOOrrrriiiiggggiiiinnnn just before using
  155.      _g_c to draw something;  after it is finished drawing, the type manager
  156.      calls XXXXSSSSeeeettttTTTTSSSSOOOOrrrriiiiggggiiiinnnn to restore the origin in _g_c back to (0,0) (the restore
  157.      is needed because graphics contexts are shared, so they cannot be
  158.      modified permanently).
  159.  
  160.      TTTTkkkk____CCCCaaaannnnvvvvaaaassssWWWWiiiinnnnddddoooowwwwCCCCoooooooorrrrddddssss is similar to TTTTkkkk____CCCCaaaannnnvvvvaaaassssDDDDrrrraaaawwwwaaaabbbblllleeeeCCCCoooooooorrrrddddssss except that
  161.      it returns coordinates in the canvas's window on the screen, instead of
  162.      coordinates in an off-screen pixmap.
  163.  
  164.      TTTTkkkk____CCCCaaaannnnvvvvaaaassssEEEEvvvveeeennnnttttuuuuaaaallllllllyyyyRRRReeeeddddrrrraaaawwww may be invoked by a type manager to inform Tk
  165.      that a portion of a canvas needs to be redrawn.  The _x_1, _y_1, _x_2, and _y_2
  166.      arguments specify the region that needs to be redrawn, in canvas
  167.      coordinates.  Type managers rarely need to invoke
  168.      TTTTkkkk____CCCCaaaannnnvvvvaaaassssEEEEvvvveeeennnnttttuuuuaaaallllllllyyyyRRRReeeeddddrrrraaaawwww, since Tk can normally figure out when an item
  169.      has changed and make the redisplay request on its behalf (this happens,
  170.      for example whenever Tk calls a _c_o_n_f_i_g_u_r_e_P_r_o_c or _s_c_a_l_e_P_r_o_c).  The only
  171.      time that a type manager needs to call TTTTkkkk____CCCCaaaannnnvvvvaaaassssEEEEvvvveeeennnnttttuuuuaaaallllllllyyyyRRRReeeeddddrrrraaaawwww is if an
  172.      item has changed on its own without being invoked through one of the
  173.      procedures in its Tk_ItemType; this could happen, for example, in an
  174.      image item if the image is modified using image commands.
  175.  
  176.  
  177. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  178.      canvas, focus, item type, redisplay, selection, type manager
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.